<!DOCTYPE html>
<!--
本页面为仓单等申请成为数字资产的页面，提交申请后管理员确认后变成数字资产，出现在交易市场
-->
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>仓单申请</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="../bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="../bower_components/Ionicons/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="../dist/css/AdminLTE.css">
  <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
        page. However, you can choose any other skin. Make sure you
        apply the skin class to the body tag so the changes take effect. -->
  <link rel="stylesheet" href="../dist/css/skins/skin-blue.min.css">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet" href="https://fonts.useso.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
  <link rel="stylesheet" href="../dist/css/mycss.css">
  <script src="../dist/js/myjs.js"></script>
</head>
<!--
BODY TAG OPTIONS:
=================
Apply one or more of the following classes to get the
desired effect
|---------------------------------------------------------|
| SKINS         | skin-blue                               |
|               | skin-black                              |
|               | skin-purple                             |
|               | skin-yellow                             |
|               | skin-red                                |
|               | skin-green                              |
|---------------------------------------------------------|
|LAYOUT OPTIONS | fixed                                   |
|               | layout-boxed                            |
|               | layout-top-nav                          |
|               | sidebar-collapse                        |
|               | sidebar-mini                            |
|---------------------------------------------------------|
-->

<body class="hold-transition skin-blue sidebar-mini">
  <div class="wrapper">

    <!-- Main Header -->
    <header class="main-header">
    </header>
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar">
      <!-- /.sidebar -->
    </aside>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
      <!-- Content Header (Page header) -->
      <section class="content-header">
        <h1>
          首页
          <small>>用户中心>资产发行申请</small>
        </h1>
      </section>

      <!-- Main content -->
      <section class="content container-fluid">

        <!--------------------------
        | Your Page Content Here |
        -------------------------->
        <!--coded By Bobo 2017/7/13-->
        <div class="box">
          <div class="box-body">

            <div>
              <!-- Nav tabs -->


              <!-- Tab panes -->
              <!-- <div class="dropdown">
                  <button id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    <span id='text'>类型</span>
                    <span class="caret"></span>
                  </button>
                  <ul class="dropdown-menu" aria-labelledby="dLabel">
                    <li>大宗实物</li>
                    <li>票据</li>
                    <li>产能</li>
                    <li>服务</li>
                    <li>其他</li>
                  </ul>
                </div> -->

              <div class="col-md-12 col-sm-12" style="padding-left:10%" id="radioset">
                <label for="radio">类型:</label>
                <input type="radio" name="zichan_type" value="大宗实物" checked> 大宗实物
                <input type="radio" name="zichan_type" value="票据"> 票据
                <input type="radio" name="zichan_type" value="产能"> 产能
                <input type="radio" name="zichan_type" value="服务"> 服务
                <input type="radio" name="zichan_type" value="其他"> 其他
                <a class="btn disabled btn-primary btn-sm pull-right" >批量申请</a>
              </div>

              <div class="tab-content">
                <br>
                <br>
                <form class="form-horizontal">
                  <div class="form-group form-group-md">
                    <label for="username" class="col-sm-2 control-label">电子仓单号</label>
                    <div class="col-md-2"><input id="cangdanId" type="text" class="form-control"></div>

                    <label for="username" class="col-sm-2 control-label">品名</label>
                    <div class="col-md-2"> <input id="pinming" type="text" class="form-control"></div>

                    <label for="username" class="col-sm-2 control-label">价值</label>
                    <div class="col-md-2"> <input id="money" type="text" class="form-control"></div>

                  </div>
                  <br>

                  <div class="form-group form-group-md">
                    <label for="username" class="col-sm-2 control-label">规格</label>
                    <div class="col-md-2"> <input id="guige" type="text" class="form-control"></div>

                    <label for="username" class="col-sm-2 control-label">材质</label>
                    <div class="col-md-2"> <input id="caizhi" type="text" class="form-control"></div>

                    <label for="username" class="col-sm-2 control-label">件数</label>
                    <div class="col-md-2"><input id="jianshu" type="text" class="form-control"></div>


                  </div>
                  <br>

                  <div class="form-group form-group-md">
                    <label for="username" class="col-sm-2 control-label">重量</label>
                    <div class="col-md-2"><input id="zhongliang" type="text" class="form-control"></div>

                    <label for="username" class="col-sm-2 control-label">产地</label>
                    <div class="col-md-2"><input id="chandi" type="text" class="form-control"></div>

                    <label for="username" class="col-sm-2 control-label">交割仓库</label>
                    <div class="col-md-2"><input id="cangku" type="text" class="form-control"></div>

                  </div>
                  <br>

                  <div class="col-md-offset-5 col-md-2">
                    <a class="btn btn-primary btn-sm btn-block" onclick="addReceipt()">资产发行申请</a>
                  </div>
                </form>
              </div>


            </div>
          </div>
          <!-- /.box-body -->
        </div>
      </section>
      <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    <!-- Main Footer -->
    <footer class="main-footer">
    </footer>
    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
      <!-- Create the tabs -->
      <ul class="nav nav-tabs nav-justified control-sidebar-tabs">
        <li class="active"><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
        <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
      </ul>
      <!-- Tab panes -->
      <div class="tab-content">
        <!-- Settings tab content -->
        <div class="tab-pane" id="control-sidebar-settings-tab">
          <form method="post">
            <h3 class="control-sidebar-heading">General Settings</h3>

            <div class="form-group">
              <label class="control-sidebar-subheading">
              Report panel usage
              <input type="checkbox" class="pull-right" checked>
            </label>

              <p>
                Some information about this general settings option
              </p>
            </div>
            <!-- /.form-group -->
          </form>
        </div>
        <!-- /.tab-pane -->
      </div>
    </aside>
    <!-- /.control-sidebar -->
    <!-- Add the sidebar's background. This div must be placed
  immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
  </div>
  <!-- ./wrapper -->

  <!-- REQUIRED JS SCRIPTS -->

  <!-- jQuery 3 -->
  <script src="../bower_components/jquery/dist/jquery.min.js"></script>
  <!-- Bootstrap 3.3.7 -->
  <script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  <!-- AdminLTE App -->
  <script src="../dist/js/adminlte.js"></script>
  <script src="../dist/js/myjs.js"></script>
  <!-- Optionally, you can add Slimscroll and FastClick plugins.
     Both of these plugins are recommended to enhance the
     user experience. -->
  <script>
    /*
   *加载header、sider和footer
  */
    $(".main-header").load("mainheader.html");
    $(".main-sidebar").load("mainsider.html");
    $(".main-footer").load("../mainfooter.html");
    $(document).ready(function(){
        $(".target").removeClass("highlight");
      $(".apply").addClass("highlight");
   });
// /*类型下拉选项
// **/
// $('.dropdown-menu').on('click', function(e) {
// 	var $target = $(e.target);
// 	$target.is('li') && $('#text').text($target.text())
// })


//
  </script>
  <script>
    function getCookie(objName) {//获取指定名称的cookie的值   
      var arrStr = document.cookie.split("; ");
      for (var i = 0; i < arrStr.length; i++) {
        var temp = arrStr[i].split("=");
        if (temp[0] == objName)
          return unescape(temp[1]);
      }
    }
    var name = getCookie("name");
    $("#name").html(name);
    console.log('testid' + name);
    var password = getCookie("password");

    function addReceipt() {
      var type = document.getElementsByName("zichan_type");
      var postBody = {
        userId: name,
        cangdanId: $("#cangdanId").val(),  //仓单编号
        type: $('input[type="radio"]:checked').val(),//类型（大宗实物、票据、产能、实物）
        // type: 1,   
        money: $("#money").val(),
        //        userId: name,//用户ID
        pinming: $("#pinming").val(), //品名
        guige: $("#guige").val(), //
        caizhi: $("#caizhi").val(), //
        chandi: $("#chandi").val(), //
        shuliang: $("#jianshu").val(), //
        zhongliang: $("#zhongliang").val(), //
        jianshu: $("#jianshu").val(), //
        cangku: $("#cangku").val(),  //交割仓库

      };
      console.log(postBody.username + " " + postBody.password);
      $.ajax({
        type: 'POST',
        url: '/check/zichanApply/app',
        data: postBody,
        dataType: 'json',
        success: function (data) {
          alert("资产发行申请单已经提交申请成功，正等待受理");
          $("#money").val()
        }
      }).error(function (err) {
        console.log(err);
        alert("错误：" + err.responseText);
      });
    }

    var a = getCookie("content");
    console.log(a);
    document.getElementById('name').innerHTML = name;
    function delCookie(name) {//为了删除指定名称的cookie，可以将其过期时间设定为一个过去的时间   
      var date = new Date();
      date.setTime(date.getTime() - 10000);
      document.cookie = name + "=a; expires=" + date.toGMTString();
    }
    function del_() {
      delCookie(name);
      delCookie(password);
      window.location.href = "index.html";
    }
    function login_out() {
      delCookie(getCookie("name"));
      setTimeout("window.location.href='login.html'", 1000);
    }
  </script>
</body>

</html>